<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

use Illuminate\Support\Facades\Route;

Route::namespace('user')->group(function (){
    //需要登录并且进行鉴权
    Route::prefix('user')->middleware('UserMiddleware')->group(function (){
        Route::get('user_info','UsersController@user_info');
        Route::get('users_count_data','UsersController@users_count_data');
        Route::get('rLists','UsersController@rLists');
        Route::get('widthwal_lists','UsersController@widthwal_lists');
        Route::get('bills','UsersController@bills');
        Route::get('bills_score','UsersController@bills_score');
        Route::post('set_id_card','UsersController@set_id_card');
        Route::post('recharge','UsersController@recharge');
        Route::post('score_to_balance','UsersController@score_to_balance');
        Route::post('balance_to_user','UsersController@balance_to_user');
        Route::post('score_to_balance_to_user','UsersController@score_to_balance_to_user');
        Route::post('update_pay_pass','UsersController@update_pay_pass');
        Route::post('set_card_json','UsersController@setCardJson');
        Route::post('widthwal','UsersController@widthwal');
        Route::post('update_user_info','UsersController@update_user_info');






        Route::post('add_order','OrdersController@add_order');
        Route::post('confirm_order','OrdersController@confirm_order');
        Route::get('orders','OrdersController@orders');
        Route::get('getShareInfo','OrdersController@getShareInfo');
        Route::get('orders_info','OrdersController@orders_info');

        Route::get('orders_line','OrdersController@orders_line');



        Route::post('add_address','AddressController@add_address');
        Route::post('set_default_address','AddressController@set_default_address');
        Route::post('update_address','AddressController@update_address');
        Route::post('delete_address','AddressController@delete_address');
        Route::post('addresses','AddressController@lists');





        Route::get('get_tuan_users','UsersController@get_tuan_users');
        Route::get('chats','CommonController@chats');
        Route::post('add_chat','CommonController@add_chat');


        Route::post('users_upgrade','PersonalController@users_upgrade');
        Route::post('users_upgrade_confirm','PersonalController@users_upgrade_confirm');
        Route::post('user_urgrade_lists','PersonalController@user_urgrade_lists');
        Route::post('agree_user_urgrade','PersonalController@agree_user_urgrade');

        Route::get('share_code','UsersController@share_code');//用户邀请二维码
        Route::post('update_user_info_wx','UsersController@update_user_info_wx');//用户邀请二维码
        Route::get('get_recom_user','UsersController@get_recom_user');//获取用户直推
        Route::post('order_zi_ti','OrdersController@order_zi_ti');
    });




    //不需要登录的后台接口
    Route::prefix('user')->group(function (){
        Route::get('url_img','PersonalController@url_img');//用户邀请二维码

        Route::post('register','UsersController@register');//后台用户登录
        Route::post('do_login','UsersController@do_login');//后台用户登录
        Route::post('login_u','UsersController@login_u');//后台用户登录
        Route::any('user_login_lists','UsersController@user_login_lists');//后台用户登录
        Route::any('test','CommonController@test');//后台用户登录
        Route::any('commons','CommonController@commons');//后台用户登录
        Route::any('qr_code','CommonController@qr_code');//后台用户登录
        Route::get('categorys','CommonController@categorys');
        Route::post('send_sms','CommonController@send_sms');

        Route::any('plutocrats','CommonController@plutocrats');


        Route::any('forget_pass','UsersController@forget_pay_pass');

        Route::any('file_up','CommonController@file_up');
        Route::get('goods','GoodsController@goods');
        Route::get('goods_info','GoodsController@goods_info');
        Route::any('cursors','CommonController@cursors');
        Route::any('notice_recharge','NoticeController@notice_recharge')->name('notice_recharge');
        Route::any('notice_pay_goods','NoticeController@notice_pay_goods')->name('notice_pay_goods');
        Route::any('notice_fadada','NoticeController@notice_fadada')->name('fadada');
    });
});
